Skip to content

Add concurrency policy to e2e.yml workflow to prevent overlapping runs#361

Merged
pelikhan merged 2 commits into
mainfrom
copilot/fix-3e22d8be-9b2b-46e2-9f40-5c6af88b785c
Sep 22, 2025
Merged

Add concurrency policy to e2e.yml workflow to prevent overlapping runs#361
pelikhan merged 2 commits into
mainfrom
copilot/fix-3e22d8be-9b2b-46e2-9f40-5c6af88b785c

Conversation

Copilot AI commented Sep 22, 2025

Copy link
Copy Markdown
Contributor

This PR adds a concurrency policy to the e2e.yml workflow to automatically cancel in-progress runs when new ones are triggered, preventing resource conflicts and ensuring efficient CI usage.

Problem

The e2e workflow can be triggered by multiple sources:

  • Nightly schedule (3:00 AM UTC)
  • Manual workflow dispatch
  • Changes to the workflow file itself

Without concurrency control, multiple instances can run simultaneously, potentially causing:

  • Resource conflicts between test runs
  • Interference with test artifacts and GitHub API operations
  • Wasted CI resources on redundant runs

Solution

Added a concurrency configuration that uses the workflow name as the grouping key:

concurrency:
  group: ${{ github.workflow }}
  cancel-in-progress: true

This ensures that:

  • Only one instance of the "Nightly E2E Tests" workflow runs at a time
  • Any in-progress run is automatically cancelled when a new one starts
  • The most recent trigger always takes precedence
  • No git reference is included in the grouping key, so all triggers are treated equally

Benefits

  • Prevents conflicts: Eliminates interference between concurrent test runs
  • Saves resources: Avoids running redundant workflows
  • Ensures freshness: Always tests the latest changes when multiple triggers occur
  • Maintains reliability: Reduces flaky test failures caused by resource contention

The change is minimal and surgical, adding only 4 lines to the existing workflow without affecting any other functionality.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Add concurrency policy in e2e.yml to cancel the run in progress if another one starts. use workflow id as key, no ref. Add concurrency policy to e2e.yml workflow to prevent overlapping runs Sep 22, 2025
Copilot AI requested a review from pelikhan September 22, 2025 22:48
@pelikhan pelikhan marked this pull request as ready for review September 22, 2025 23:01
@pelikhan pelikhan merged commit 1cecd9a into main Sep 22, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants